﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Web.Mvc;

namespace $safeprojectname$.Web
{
    /// <summary>
    ///     Base controller for web applications
    ///     Containing IViewModel
    /// </summary>
    public interface IWebController<out TModel> : ICoreController<TModel>
        where TModel : class, IViewModel
    {
        #region properties
        /// <summary>
        ///     Property which allows to distinguish among controllers
        ///     Usually the Name without suffix should be provided.
        ///     (Used in DescriptionWC etc.)
        /// </summary>
        string ControllerName { get; }

        /// <summary>
        ///     Routing machine. This one allowes to inject some new parameters
        ///     into the every link this way created
        /// </summary>
        IUrlHelper Url { get; }

        /// <summary>
        /// Temporary data, surviving only while requests are "Redirected"
        /// </summary>
        TempDataDictionary TempData { get; }
        #endregion properties

        /// <summary>
        ///     Fills provided object T with data from Form or QueryString
        /// </summary>
        /// <param name = "model"></param>
        /// <param name = "prefix"></param>
        /// <param name = "includeProperties"></param>
        /// <param name = "excludeProperties"></param>
        /// <param name = "valueProvider"></param>
        /// <returns></returns>
        bool BindModel<T>(T model
            , string prefix = null
            , string[] includeProperties = null
            , string[] excludeProperties = null
            , IValueProvider valueProvider = null)
            where T : class;
    }
}